<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断可以进入网吧吗</title>

    <script>
        var age = prompt('请输入你的年龄');
        if (parseInt(age) < 0 || parseInt(age) > 100) {
            alert('请输入正确的年龄范围');
        } else if (parseInt(age) >= 18) {
            alert('你可以进入网吧');
        } else {
            alert('你还未成年');
        }
    </script>

</head>

<body>

</body>

</html>